﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate.Audit.Mapping;
using NHibernate.Mapping;

namespace NHibernate.Audit.Unit.Mapping
{
    public class MappingsFacadeFake : IMappingsFacade 
    {

        public Dictionary<string, PersistentClass> AddedClasses = new Dictionary<string, PersistentClass>();

        #region IMappingsFacade Members

        public void CreatePrimaryKeyFor(PersistentClass clazz)
        {
            // Do nothing
        }

        public void AddClass(PersistentClass clazz)
        {
            AddedClasses.Add(string.IsNullOrEmpty(clazz.EntityName) ? clazz.ClassName : clazz.EntityName, clazz);
        }

        #endregion

        #region ITableFactory Members

        public Table CreateTable(string Catalog, string Schema, string Name, bool IsAbstract)
        {
            return new Table()
            {
                Catalog = Catalog,
                Schema = Schema,
                Name = Name,
                IsAbstract = IsAbstract
            };
        }

        #endregion
    }
}
